import request from '@/utils/request'
// 获取角色列表
export const roleList = () => {
  return request({
    method: 'get',
    url: '/roles'
  })
}
// 删除角色对应的权限
export const removeRights = (roleId, rightId) => {
  return request({
    method: 'delete',
    url: `/roles/${roleId}/rights/${rightId}`
  })
}
// 给角色分配权限
export const setRights = (roleId, rids) => {
  return request({
    method: 'post',
    url: `/roles/${roleId}/rights`,
    data: {
      rids
    }
  })
}
